<template>
  <div id="app">

    <!--登陆-->
     <div class="login" v-show="false">
      <div class="logintip fl">
        <p>立即登录 体验共享驾驭乐趣</p>
        <p>新用户可享 <span>首单1元3小时</span> 用车优惠</p>
      </div>
      <div class="loginBtn fr">登录/注册</div>
    </div>
    <!--优惠券-->
    <!-- <div class="coupon">
      <p class="fl">您有一张 <span>首单1元3小时</span> 体验券</p>
      <div class="line fl"></div>
      <div class="close fr" @click.stop.prevent="close">+</div>
    </div> -->
    <!--违章-->
    <div class="illegal" v-show="false">
      <p class="fl">您有 <span>{{illegalnum}}</span> 个违章需要前往APP处理</p>
      <a class="deal fr" href="tel:4000190808">联系客服</a>
    </div>
    <router-view/>


    <!-- <login-bar></login-bar> -->
    <!-- <coupon-tip></coupon-tip> -->
    <!-- <break-rule></break-rule> -->
    <!-- <wait-time></wait-time> -->
    <!-- <use-car-info></use-car-info> -->
    <!-- <login-model></login-model> -->
    <!-- <coupon-list></coupon-list> -->


    <!-- <auto-focus></auto-focus> -->
    <!-- <quality-certification></quality-certification> -->
    <!-- <pay-deposit></pay-deposit> -->
    <!-- <pay-money></pay-money> -->
    <!-- <pay-order></pay-order> -->
    <!-- <b-map></b-map> -->
    <!-- <waitcar></waitcar> -->


  </div>
</template>

<script>

import LoginBar from './components/LoginBar'
import CouponTip from './components/CouponTip'
import BannerTip from './components/BannerTip'
import WaitTime from './components/WaitTime'
import UseCarInfo from './components/UseCarInfo'

import LoginModel from './pages/LoginModel'
import CouponList from './pages/CouponList'
import QualityCertification from './pages/QualityCertification'
import PayDeposit from './pages/PayDeposit'
import PayMoney from './pages/PayMoney'
import PayOrder from './pages/PayOrder'
import AutoFocus from './pages/AutoFocus'
import CMap from './pages/CMap'

import waitcar from './frame/waitcar'

export default {
  components: {
    LoginBar,
    CouponTip,
    BannerTip,
    UseCarInfo,
    WaitTime,
    LoginModel,
    CouponList,
    QualityCertification,
    PayDeposit,
    PayMoney,
    PayOrder,
    AutoFocus,
    CMap,

    waitcar,
    Map
  },

  data () {
    return {
      // 违章个数
      illegalnum: '1'
    }
  },
  methods: {
    putup () {
      $('#getcar,.getcar,#rebackpark,.rebackpark').animate({'height': '7.2rem'}, 300)
      $('.carlist,.parklist').css({'overflow-y': 'hidden'})
      $('.rebackbg').show()
    },
    close () {
      $('.coupon').animate({'left': '-6.2rem'}, 500)
    },
    getlocation () {
      var _this = this
      var geolocation = new BMap.Geolocation()
      geolocation.getCurrentPosition(function (r) {
        if (this.getStatus() == BMAP_STATUS_SUCCESS) {
          // console.log(r, _this)
          sessionStorage.positionLon = r.point.lng
          sessionStorage.positionLat = r.point.lat
          sessionStorage.city_code = r.city_code
          if (!sessionStorage.judge) {
            sessionStorage.judge = 'aa'
            _this.$router.push('Getcar')
          }
        } else {
          console.log('failed' + this.getStatus())
        }
      }, {enableHighAccuracy: true})
    }
  },
  created: function () {
    // this.$router.push('Waitcar')
    // console.log('create')
// 别忘了解开
    this.getlocation();
    // this.$router.push('/Reserve')
  }
}
</script>

<style lang="scss">
  @import "style/base/reset";
  @import 'style/style';
  .wait-map {
    z-index: 500;
  }
</style>
